package test.serverframe.armc.server.manager.dao.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import test.serverframe.armc.server.manager.domain.InvokeEnterTag;

public interface InvokeEnterTagMapper {
    @Delete({
        "delete from tb_ssgp_invoke_enter_tag",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);
    @Delete({
            " delete from tb_ssgp_invoke_enter_tag ",
            " where invoke_id = #{taskInvokeId,jdbcType=VARCHAR}"
    })
    int deleteByTaskInvokeId(String taskInvokeId);

    @Insert({
        "insert into tb_ssgp_invoke_enter_tag (id, invoke_id, ",
        "tag_id)",
        "values (#{id,jdbcType=VARCHAR}, #{invokeId,jdbcType=VARCHAR}, ",
        "#{tagId,jdbcType=VARCHAR})"
    })
    int insert(InvokeEnterTag record);

    @InsertProvider(type=InvokeEnterTagSqlProvider.class, method="insertSelective")
    int insertSelective(InvokeEnterTag record);

    @Select({
        "select",
        "id, invoke_id, tag_id",
        "from tb_ssgp_invoke_enter_tag",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="invoke_id", property="invokeId", jdbcType=JdbcType.VARCHAR),
        @Result(column="tag_id", property="tagId", jdbcType=JdbcType.VARCHAR)
    })
    InvokeEnterTag selectByPrimaryKey(String id);

    @UpdateProvider(type=InvokeEnterTagSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(InvokeEnterTag record);

    @Update({
        "update tb_ssgp_invoke_enter_tag",
        "set invoke_id = #{invokeId,jdbcType=VARCHAR},",
          "tag_id = #{tagId,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(InvokeEnterTag record);
}